<?php if (!defined('THINK_PATH')) exit();?><link href="/rywechat/Public/plugins/fitui/tablegrid.css" rel="stylesheet">
<script src="/rywechat/Public/js/backend/format.js"></script>
<script src="/rywechat/Public/plugins/fitui/tablegrid.js"></script>
<script src="/rywechat/Public/js/backend/sys_dictionary.js"></script>
<style type="text/css">

</style>
<script>
var Param = <?php echo json_encode( $param ) ?> ;
$(function(){
  SysDictionary.init(<?php echo json_encode( $config ) ?>);
});

</script>

<div class="page-content">
  <ol class="breadcrumb">
    <li><a href="<?php echo $home_url ?>">首页</a></li>
    <li class="active"><?php echo $module_name ?></li>
  </ol>
  <div class="page-content-inner"> 
    <!-- read_modal -->
    <div class="portlet blue" id="read_modal"> 
      <!-- portlet-title -->
      <div class="portlet-title">
        <div class="caption"> 
          <i class="fa fa-th-list "></i> 
          <?php echo $module_name ?> 
          <?php if ( !empty( $pdata ) ) :?>
          <?php echo $pdata['text'] ?> 的下属
          <?php endif ; ?>
        </div>
        <div class="tools"> 
          <?php if ( $opt_data == 1 || in_array( '添加' , $opt_data ) ) : ?>
          <a href="<?php echo $module_url ?>?action=create" class="toolbtn add load_add_modal_btn" data-toggle="tooltip" data-placement="top" title="新增"></a> 
          <?php endif ; ?>
        </div>
      </div>
      <!-- end portlet-title -->
      <div class="portlet-body "> 
        <!-- table grid -->
        <div class="table-responsive">
          <table id="data_table" class="table table-striped table-hover table-condensed">
            <thead>
              <tr>
                <th width="60" data-field="id" data-sortable="true" >ID</th>
                <th width="120" data-field="text"  >名称</th>
                <th width="60" data-field="sort" data-sortable="true" >排序</th>
                <th width="160" data-field="tip"  >提示</th>
                <th width="120" data-field="create_date" data-formatter="format_date" >创建时间</th>
                <th width="120" data-field="update_date" data-formatter="format_date" >更新时间</th>
                <th width="200" data-field="expand"  >扩展数据</th>
                <th width="80" data-field="allow_del" data-formatter="format_is_del" >允许删除</th>
                <?php if ( $opt_data == 1 || in_array( '查看下属' , $opt_data ) ) : ?><th width="80" data-formatter="opt_son"></th><?php endif ; ?>
                <?php if ( $opt_data == 1 || in_array( '编辑' , $opt_data ) ) : ?><th width="80" data-formatter="opt_edit"></th><?php endif ; ?>
                <?php if ( $opt_data == 1 || in_array( '删除' , $opt_data ) ) : ?><th width="80" data-formatter="opt_delete"></th><?php endif ; ?>
                <th>&nbsp;</th>
              </tr>
            </thead>
          </table>
        </div>
        <!-- end table --> 
        <?php if( !empty( $config['pid'] ) ) : ?>
        <div class="row" style="text-align:center; margin-top:60px;">
          <button type="button" class="btn btn-lg btn-default" onClick="javascript:history.go(-1)"><i class="fa fa-arrow-left"></i> 返回</button>
        </div>
        <?php endif ; ?>
      </div>
    </div>
    <!-- end portlet read_modal --> 
    
    <!-- add_edit_modal  -->
    <div class="portlet" id="add_edit_modal" style="display:none;">
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-cogs"></i> <span id="action_label"></span> <?php echo $module_name ?> </div>
      </div>
      <div class="portlet-body ">
        <form id="submit_form" class="form-horizontal">


          <div class="form-group">
            <label class="col-sm-3 control-label">名称</label>
            <div class="col-sm-7">
              <input name="text" placeholder="名称" data-valid="required" data-tips="请填写正确的名称" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">排序</label>
            <div class="col-sm-7">
              <input name="sort" placeholder="排序" data-valid="required" data-tips="请填写正确的排序" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">提示</label>
            <div class="col-sm-7">
              <input name="tip" placeholder="提示" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">扩展数据</label>
            <div class="col-sm-7">
              <input name="expand" placeholder="扩展数据" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">允许删除</label>
            <div class="col-sm-7">
              <?php echo form_radios('allow_del' , array( 0 => '否' , 1 => '是') ) ?>
            </div>
          </div>
          <hr>
          <div class="row">
            <div class="col-md-12" style="text-align:center">
              <button class="btn btn-default btn-lg " id="add_edit_close_btn" type="button"><i class="fa fa-arrow-left"></i> 返回</button>
              <button class="btn btn-danger btn-lg " id="submit_btn" type="button"><i class="fa fa-check"></i> 提交</button>            
            </div>
          </div>
        </form>
      </div>
    </div>
    <!-- end portlet add_edit_modal --> 
  </div>
  <!-- end page-content-inner --> 
</div>